

package com.kimo.shop.admin.controller;

import com.kimo.shop.bean.dto.SankeyDto;
import com.kimo.shop.bean.param.FlowRouteAnalysisParam;
import com.kimo.shop.service.FlowRouteAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kimo-taozhouchuan on 2018/11/26.
 */
@RestController
@RequestMapping("/admin/flowRouteAnalysis")
public class FlowRouteAnalysisController {

    @Autowired
    private FlowRouteAnalysisService flowRouteAnalysisService;

    /**
     * 分页获取
     */
    @GetMapping("/getRoutData")
    public ResponseEntity<FlowRouteAnalysisParam> getRoutData(FlowRouteAnalysisParam flowRouteAnalysisParam) {
        flowRouteAnalysisParam.setTime();
        SankeyDto sankeyDto = flowRouteAnalysisService.getRoutData(flowRouteAnalysisParam);
        flowRouteAnalysisParam.setSankeyDto(sankeyDto);
        return ResponseEntity.ok(flowRouteAnalysisParam);
    }
}
